package xyz.zdsoft.attendance_manage_module.utils;

import java.util.Collection;
import java.util.Date;

/**
 * @author 王林
 * @version 1.0
 * @date 2021-07-24 周六
 * @time 10:04
 * @description
 */
public class NotNull {

    public static boolean judge(String value) {
        if (value == null) {
            return false;
        } else {
            return !value.isEmpty();
        }
    }

    public static boolean judge(Date time) {
        if ("".equals(time)) {
            return false;
        }
        return time != null;
    }

    public static boolean judge(Integer value) {
        return value != null && value != -1;
    }

    public static boolean judge(Collection value) {
        return value != null && !value.isEmpty();
    }

    public static boolean judge(Float value) {
        return value != null && value >= 0;
    }

    public static boolean score(Float value) {
        return judge(value) && value >= 0 && value <= 100;
    }
}
